package com.baor.order.service.impl;

import java.util.List;
import com.baor.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baor.order.mapper.TReviewsMapper;
import com.baor.order.domain.TReviews;
import com.baor.order.service.ITReviewsService;

/**
 * 商品评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-18
 */
@Service
public class TReviewsServiceImpl implements ITReviewsService 
{
    @Autowired
    private TReviewsMapper tReviewsMapper;

    /**
     * 查询商品评价
     * 
     * @param reviewsId 商品评价主键
     * @return 商品评价
     */
    @Override
    public TReviews selectTReviewsByReviewsId(Long reviewsId)
    {
        return tReviewsMapper.selectTReviewsByReviewsId(reviewsId);
    }

    /**
     * 查询商品评价列表
     * 
     * @param tReviews 商品评价
     * @return 商品评价
     */
    @Override
    public List<TReviews> selectTReviewsList(TReviews tReviews)
    {
        return tReviewsMapper.selectTReviewsList(tReviews);
    }

    /**
     * 新增商品评价
     * 
     * @param tReviews 商品评价
     * @return 结果
     */
    @Override
    public int insertTReviews(TReviews tReviews)
    {
        tReviews.setCreateTime(DateUtils.getNowDate());
        return tReviewsMapper.insertTReviews(tReviews);
    }

    @Override
    public int insertTReviewsReply(TReviews tReviews) {
        return tReviewsMapper.insertTReviewsReply(tReviews);
    }

    @Override
    public int updateTReviewsTop(TReviews tReviews) {
        return tReviewsMapper.updateTReviewsTop(tReviews);
    }

    @Override
    public int updateTReviewsCancelTop(TReviews tReviews) {
        return tReviewsMapper.updateTReviewsCancelTop(tReviews);
    }

    @Override
    public int deleteTReviews(TReviews tReviews) {
        return tReviewsMapper.deleteTReviews(tReviews);
    }

    /**
     * 修改商品评价
     * 
     * @param tReviews 商品评价
     * @return 结果
     */
    @Override
    public int updateTReviews(TReviews tReviews)
    {
        return tReviewsMapper.updateTReviews(tReviews);
    }

    /**
     * 批量删除商品评价
     * 
     * @param reviewsIds 需要删除的商品评价主键
     * @return 结果
     */
    @Override
    public int deleteTReviewsByReviewsIds(Long[] reviewsIds)
    {
        return tReviewsMapper.deleteTReviewsByReviewsIds(reviewsIds);
    }

    /**
     * 删除商品评价信息
     * 
     * @param reviewsId 商品评价主键
     * @return 结果
     */
    @Override
    public int deleteTReviewsByReviewsId(Long reviewsId)
    {
        return tReviewsMapper.deleteTReviewsByReviewsId(reviewsId);
    }
}
